<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8" />
<head>
<title>媒体管理 <?php echo $this->config->item('title');?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet"
	href="<?php echo base_url()?>public/css/bootstrap.min.css">
<link rel="stylesheet"
	href="<?php echo base_url()?>public/css/style.css">
	<script src="<?php echo base_url()?>public/js/jquery-2.0.2.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap-confirm.js"></script>
	<script src='<?php echo base_url()?>public/js/ssi_common.js'></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#province").change(function(){
				$("#city").html('<option value="">请选择</option>');
				$("#region").html('<option value="">请选择</option>');

				var province =$("#province").val();
				if(!province){
					return false;
				}
				$.getJSON("<?php echo base_url()."index.php/sys_region_manage/get_regions"?>", { region_id: province }, function(json){
					if (json.length == 0) {
						return;
					}
					for(var i = 0, len = json.length; i<len; ++i){
						var region = json[i];
						$("#city").append("<option value=" + region.region_id + ">" + region.region_name + "</option>");
					}
				});
			});
			$("#city").change(function(){
				$("#region").html('<option value="">请选择</option>');

				var city =$("#city").val();
				$.getJSON("<?php echo base_url()."index.php/sys_region_manage/get_regions"?>", { region_id: city }, function(json){
					if (json.length == 0) {
						return;
					}
					for(var i = 0, len = json.length; i<len; ++i){
						var region = json[i];
						$("#region").append("<option value=" + region.region_id + ">" + region.region_name + "</option>");
					}
				});
			});
		});
	</script>
</head>
<body>
	<div role="navigation" class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand">SSI后台管理系统</a>
			</div>
			<div class="collapse navbar-collapse navbar-right">
				<ul class="nav navbar-nav">
					<li><a href="<?php echo base_url()?>" class="navbar-link">首页</a>
					</li>
					<li><a
						href="<?php echo base_url()."index.php/common_login_user_set"?>"
						class="navbar-link">超级管理员</a>
					</li>
					<li><a
						href="<?php echo base_url()?>index.php/common_login_manage/logout"
						class="navbar-link">退出</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-xs-3">
				<?php echo $user_menu?>
			</div>
			<div class="col-sm-9">
				<ul class="nav nav-tabs">
					<li ><a
						href="<?php echo base_url()."index.php/media_media_manage"?>">我的媒体</a>
					</li>
					<li class="active"><a
						href="<?php echo base_url()."index.php/media_media_manage/check_list"?>">待我审核</a>
					</li>
					<li><a
						href="<?php echo base_url()."index.php/media_media_manage/media_list"?>">已发布媒体</a>
					</li>
				</ul>
				<br>
				<div class="panel panel-default">
					<div class="panel-body">
						<form action=""  method="get">
							<table width="100%"  class="search_table">
								<tr>
									<td width="50%">
									所属区域:
									<select id ="province" name="province" class="form-control" >
									<option value="">请选择</option>
									<?php if ($province_list!=null) {	foreach ($province_list as $province){	?><option value="<?php echo $province['region_id']?>" <?php echo $province['region_id']==$search['province']?'selected="selected"':''?> ><?php echo $province['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									<select id ="city" name="city" class="form-control">
									<option value="">请选择</option>
									<?php if ($city_list!=null) {	foreach ($city_list as $city){	?><option value="<?php echo $city['region_id']?>" <?php echo $city['region_id']==$search['city']?'selected="selected"':''?> ><?php echo $city['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									<select id ="region" name="region" class="form-control">
									<option value="">请选择</option>
									<?php if ($region_list!=null) {	foreach ($region_list as $region){	?><option value="<?php echo $region['region_id']?>" <?php echo $region['region_id']==$search['region']?'selected="selected"':''?> ><?php echo $region['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									
									</td>
									<td>媒体分类: 
										<select id ="media_type_id" name="media_type_id" class="form-control full_td">
										<option value="">请选择</option>
										<?php if ($media_type_list!=null) {	foreach ($media_type_list as $media_type){	?><option value="<?php echo $media_type['media_type_id']?>" <?php echo $media_type['media_type_id']==$search['media_type_id']?'selected="selected"':''?> ><?php echo $media_type['media_type_name']?></option>
										<?php 
											}
										}?>
										</select> 
									</td>
								</tr>
								<tr>
									<td>　关键字: <input type="text" name="keyword" class="form-control full_td"  value="<?php echo $search['keyword']?>" /></td>
									<td>媒体类型: <select name="media_type" class="form-control full_td">
													<option value="">请选择</option>
													<option value="led" 	<?php echo $search['media_type']=="led"?'selected="selected"':''?>>市区LED大牌</option>
													<option value="common" 	<?php echo $search['media_type']=="common"?'selected="selected"':''?>>市区常规大牌</option>
													<option value="highway" <?php echo $search['media_type']=="highway"?'selected="selected"':''?>>高速公路大牌</option>
													<option value="airport" <?php echo $search['media_type']=="airport"?'selected="selected"':''?>>机场大牌</option>
												</select>
									</td>
								</tr>
								<tr>
									<td colspan="2" align="right"><input type="submit" class="btn btn-primary" value="搜索"></td>
								</tr>
							</table>
						</form>
					</div>
				</div>
				<div class="panel-body">
					<table class="table table-hover">
						<thead>
							<tr>
								<td class="col-md-3"><b>媒体类型</b>
								</td>
								<td class="col-md-6"><b>媒体位置</b>
								</td>
								<td class="col-md-2"><b>操作</b>
								</td>
							</tr>
						</thead>
						<tbody>
							<?php if ($media_draft_list!=null) {
								foreach ($media_draft_list as $media){
								?>
							<tr
							<?php if ($media['media_status']==0) {
								echo 'class="warning"';
							}elseif ($media['media_status']==10) {
									echo '';
								}if ($media['media_status']==20) {
									echo 'class="danger"';
								}?>>
								<td><?php if ($media['media_type']=="led") {
									echo "市区LED大牌";
								}elseif ($media['media_type']=="common") {
									echo "市区常规大牌";
								}elseif ($media['media_type']=="highway") {
									echo "高速公路大牌";
								}elseif ($media['media_type']=="airport") {
									echo "机场大牌";
								}elseif ($media['media_type']=="airport_led") {
									echo "机场LED大牌";
								}?>
								</td>
								<td><?php echo $media['location'] ?>
								</td>
								<td><a title="审核" 
									href="<?php echo base_url()."index.php/media_media_manage/check_media_draft?media_draft_id=".$media['media_draft_id']?>"
									class="btn btn-link "> 
									<span class="glyphicon glyphicon-user"></span>
								</a> 
								</td>
							</tr>
							<?php }
								}?>
						</tbody>
					</table>
				</div>
			</div>
			<ul class="pagination pull-right">
				<?php echo $page_link?>
			</ul>

		</div>
	</div>
	</div>
<div  class="back-to" id="toolBackTop">
	<a title="返回顶部" onclick="window.scrollTo(0,0);return false;" href="#top" class="back-top">
	返回顶部</a>
	<a title="返回底部" onclick="window.scrollTo(0,document.body.scrollHeight);return false;" href="#bottom" class="back-bottom">
	返回底部</a>
</div>
</body>
</html>
